<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>[|.siteName|]</title>
    [|if .zTree|]
    <link rel="stylesheet" href="/static/zTree3/css/demo.css?t=5" type="text/css">
    <link rel="stylesheet" href="/static/zTree3/css/zTreeStyle/zTreeStyle.css" type="text/css">
    [|end|]
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/main.css">
    <script src="/static/layui/layui.js?s=36"></script>
    <script src="/static/js/main.js?s=2124"></script>
</head>

<body>
<div>
    <form>  
        <div>
            <p>
                <label id="" style="color:rgb(0, 0, 0);">说明:</label>
                <br />
                <span class="layui-badge layui-bg-blue">类型1</span>
                <label style="color:rgb(30, 159, 255);">新玩家（第一次买分3天内)，买分超过14万，输赢超过-5万的玩家</label>
                <br />
                <span class="layui-badge">类型2</span>
                <label  style="color:rgb(255, 87, 34);">新玩家（第一次买分7天内)，买分超过2000万，输赢超过-1000万的玩家</label>
                 <br />
                <span class="layui-badge layui-bg-green">类型3</span>
                <label style="color:rgb(0, 150, 136);">新玩家（第一次买分10天内)，买分超过5000万，输赢超过-1500万的玩家</label>
                <br />
                <span class="layui-badge layui-bg-orange">类型4</span>
                <label  style="color:rgb(255, 184, 0);">全平台玩家帐号，买分超过1000万且从未退分，最近十天有登录的用户</label>
            </p>
        </div>
        <hr class="layui-bg-gray">
        <div class="layui-input-inline">
            <div class="layui-inline">
                <label class="layui-form-label" style="width:70px">游戏房间:</label>
                <div class="layui-input-inline" style="width:100px">
                    <input type="number" name="UserRoomID" id="UserRoomID" lay-verify="required|number" autocomplete="off" class="layui-input" value="">
                </div>
            </div>
         
            <div class="layui-inline ">
                <label class="layui-form-label" style="width:100px">玩家控制状态：</label>
                <select name="userctrinfolist" id = "userctrinfolist" style="width:85px;height:35px" lay-verify=""  readonly>
                    <option value="">--请选择--</option> 
                    <option value="1">控制中</option>
                </select>
            </div>
            
            <div class="layui-inline ">
                <label class="layui-form-label" style="width:70px">在线状态：</label>
                <select name="useronlineinfolist" id = "useronlineinfolist" style="width:85px;height:35px" lay-verify=""  readonly>
                    <option value="">--请选择--</option>
                    <option value="1">在线</option>
                    <option value="2">离线</option>
                </select>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width:130px;">最后作弊时间小于：</label>
                <div class="layui-input-inline" style="width:100px;">
                    <input type="text" name="EndDateTime" id="EndDateTime" lay-verify="date" placeholder="" autocomplete="off" class="layui-input" value="">

                </div>
            </div> 
            <div class="layui-inline" >
                <label >类型:</label>
                <label><input id = "userkind" name="userkind" type="checkbox" value="1" />类型1 </label>
                <label><input id = "userkind" name="userkind" type="checkbox" value="2" />类型2 </label>
                <label><input id = "userkind" name="userkind" type="checkbox" value="3" />类型3 </label>
                <label><input id = "userkind" name="userkind" type="checkbox" value="4" />类型4 </label>
            </div>
            <div class="layui-inline">
                <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="starquery">开始查询</button>
            </div>

        </div>
        <br />
        <hr class="layui-bg-gray">
        <div>
            <p>
                <label id="" style="color:rgb(0, 0, 0);">玩家金币总数:</label>
                <label id="userallgold" style="color:red;">0</label>
            </p>
        </div>

    </form>
    <table  class="layui-table" id="userinfotable" lay-size="sm" lay-filter="layfilteruserinfotable"> </table> 
</div>


<script type="text/html" id="UserNewKindTpl">
    {{#  if(d.columnA == 1 ){ }}
        <span class="layui-badge layui-bg-blue">类型1</span>
    {{#  } else if (d.columnA == 2){ }}
        <span class="layui-badge">类型2</span>
    {{#  } else if (d.columnA == 3){ }}
        <span class="layui-badge layui-bg-green">类型3</span>
    {{#  } else if (d.columnA == 4){ }}
        <span class="layui-badge layui-bg-orange">类型4</span>
    {{#  } else { }}
        {{d.columnA}}
    {{#  } }}
</script>
<script type="text/html" id="UserFINSTMe">
    {{#  if(d.columnN ==="1970-01-01 08:00:00" ){ }}
    
    {{#  } else { }}
        {{d.columnN}}
    {{#  } }}
</script>

<script>
    var $;

    layui.config({
            base : "js/"
    }).use(['form','element','layer','jquery','table','laydate'], function(){
        var table = layui.table;
        var element = layui.element;
        var form = layui.form;
        var layedit = layui.layedit
        var laydate = layui.laydate;
        $ = layui.jquery;
    //监听表格复选框选择
   // table.on('checkbox(demo)', function(obj){
    //   console.log(obj);
   // });

    //监听工具条

    laydate.render({
        elem: '#EndDateTime'
    });

    ShowUserDatas();
    ShowTablesDatas(table)
    form.on('submit(starquery)', function(data) { 
        ShowTablesDatas(table)   
        return false;
    });

    //监听单元格事件
    table.on('tool(layfilteruserinfotable)', function(obj){
        var data = obj.data;
        if(obj.event === 'UserInfo'){
            window.location.href="/usersfinduser/userinfopage.html?UserID=" + data.columnB +"&UserNickName=" + data.columnC;
            return false;
        }
     });
   
    return false;
}); 


function ShowTablesDatas(thisTabble){
 
    var dUserRoomID =  document.getElementById("UserRoomID");
    var duserctrinfolist =  document.getElementById("userctrinfolist");
    var duseronlineinfolist =  document.getElementById("useronlineinfolist");
    var dEndDateTime =  document.getElementById("EndDateTime");
    var CheckBockStr = GetCheckBoxToString();
   // alert(CheckBockStr);
   // return false;
    thisTabble.render({
        elem:'#userinfotable'
        ,url:'/userrecord/userrecordnewprotecttable'
        ,where: {
                UserGameID: dUserRoomID.value
                ,userctrinfolist:duserctrinfolist.value
                ,useronlineinfolist:duseronlineinfolist.value
                ,EndDateTime:dEndDateTime.value
                ,userkind:CheckBockStr
       
        }
        ,done: function(res, curr, count) {
            GetPageTitleData(res.titleinfo)
        }
        ,cols: [[ //标题栏
            {field:'columnA',title:'类型',width:80,templet:'#UserNewKindTpl'}
            ,{field:'columnB',title:'推广号',width:120,event: 'UserInfo', style:'cursor: pointer;color: #104E8B;'}
            ,{field:'columnC',title:'昵称',width:120,event: 'UserInfo', style:'cursor: pointer;color: #104E8B;'}
            ,{field:'columnD',title:'最后登录时间',width:160}
            ,{field:'columnE',title:'资产',width:115}
            ,{field:'columnF',title:'总输赢',width:115}
            ,{field:'columnG',title:'当日输赢',width:115}
            ,{field:'columnH',title:'买分总和',width:115}
            ,{field:'columnI',title:'卖分总和',width:115}
            ,{field:'columnJ',title:'房间',width:130}
            ,{field:'columnK',title:'作弊率',width:100}
            ,{field:'columnL',title:'作弊限额',width:120}
            ,{field:'columnM',title:'运行状态',width:120}
            ,{field:'columnN',title:'作弊完成时间',width:160,templet:'#UserFINSTMe'}
                ]] 
        ,skin: 'row' //表格风格
        ,even: true
        ,page: true //是否显示分页
        ,limits: [50,100,200]
        ,limit: 100//每页默认显示的数量
        ,width: 'full-10'
        ,rules: 'all'
        ,height: 'full-290'
    });
}

function GetPageTitleData(titleinfo){
   // alert(JSON.stringify(titleinfo))
    if (titleinfo.length > 0)
    {
        document.getElementById("userallgold").innerHTML = titleinfo[0].ALLGOLD;
    }
  
    return false;
 
}

function ShowUserDatas()
{
    var nowData = getNowFormatDate();
    var dEndDateTime =  document.getElementById("EndDateTime");
    dEndDateTime.value =  nowData;        
          
} 

function getNowFormatDate() {
    var date = new Date();
    var seperator1 = "-";
 
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
    return currentdate;    
} 
function GetCheckBoxToString(){
    var duserkind= document.getElementsByName("userkind");
    var str = "";
    for(k in duserkind){
        if(duserkind[k].checked)
         {
            str += duserkind[k].value + "|";
         } 
    }
    return str;
}
</script>
</body>

</html>